import { ISystem } from '@/types/ISystem';
import { dataFormat } from '@/utils/mock';
import { mock } from 'mockjs';

/**
 * 默认菜单，每个用户都有
 */
const defaultMenu: ISystem.IMenu[] = [
	{
		id: '100000',
		name: '控制台',
		component: '/deskboard/index',
		pid: '0',
		path: '/deskboard',
		sort: 99,
		category: 2,
	},
];

const systeMenu: ISystem.IMenu[] = [
	{ id: '110000', name: '系统设置', component: '/layouts/view', pid: '0', path: '/system', sort: 99, category: 2 },
	{ id: '110001', name: '系统参数', component: '/system/config', pid: '110000', path: '/system/config', sort: 99, category: 2 },
	{ id: '110002', name: '日志管理', component: '/system/logs', pid: '110000', path: '/system/logs', sort: 99, category: 2 },
];

const permissionMenu: ISystem.IMenu[] = [
	{ id: '120000', name: '菜单权限', component: '/layouts/view', pid: '0', path: '/permission', sort: 99, category: 2 },
	{ id: '120001', name: '角色管理', component: '/permission/role', pid: '120000', path: '/permission/role', sort: 99, category: 2 },
	{ id: '120002', name: '菜单管理', component: '/permission/menu', pid: '120000', path: '/permission/menu', sort: 99, category: 2 },
];

mock('/mock/menu', 'get', dataFormat(200, [...defaultMenu, ...systeMenu, ...permissionMenu]));
